{% extends 'ForkCMSInstallerBundle:Installer:base.html.twig' %}
{% import 'ForkCMSInstallerBundle:Installer:navigation.html.twig' as macro %}

{% block navigation %}
  {{ macro.navigation('step-1') }}
{% endblock %}

{% block content %}
  <div class="row fork-module-messages">
    <div class="col-md-12">
      {% if checker.hasErrors %}
        <div class="alert alert-danger">
          <p>Your server doesn't meet the minimum requirements to run Fork CMS.</p>
        </div>
      {% endif %}
      {% if checker.hasWarnings and not checker.hasErrors %}
        <div class="alert alert-warning">
          <p>Your server might not run Fork CMS properly.</p>
        </div>
      {% endif %}
    </div>
  </div>
  <form action="index.php" method="get" id="step2" class="forkForms submitWithLink">
    <div class="row fork-module-content">
      <div class="col-md-12">
        <input type="hidden" name="step" value="2" />
        <div class="panel panel-default">
          <div class="panel-body">
            <div id="requirementsInformation">
              {% for requirementCategory in checker.requirementCategories %}
                <h3>{{ requirementCategory.name }}</h3>
                <div class="list-group">
                  {% for requirement in requirementCategory.requirements %}
                    <div class="list-group-item list-group-item-{{ requirement.status }}">
                      <h4 class="list-group-item-heading">{{ requirement.name }}</h4>
                      <p class="list-group-item-text">{{ requirement.message|raw }}</p>
                    </div>
                  {% endfor %}
                </div>
              {% endfor %}
            </div>
          </div>
          <div class="panel-footer">
            {% if checker.hasWarnings and not checker.hasErrors %}
              <div class="btn-toolbar">
                <div class="btn-group pull-right" role="group">
                  <a href="{{ path('install_step2') }}" id="installerButton" class="btn btn-primary">
                    <span class="fa fa-download" aria-hidden="true"></span> Install anyway
                  </a>
                </div>
              </div>
            {% endif %}
          </div>
        </div>
      </div>
    </div>
  </form>
{% endblock %}
